<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/3/20 0020
 * Time: 16:33
 */

namespace App\Repositories\Admin;


use App\Models\Admin\Feedback;

class FeedbackRepository
{
    /**
     * @ 通过消息id查询消息信息
     * @ 返回消息相关的完整信息
     */
    public function getById($id){
        return Feedback::where('feedback_id',$id)->with(['fromUser','toUser'])->first();
    }
    /**
     * @ 通过用户id对消息进行分组
     * @ 返回消息相关的完整信息
     */
    public function getFeedbackUserList(){
        return Feedback::groupBy('feedback_from_user_id')->with(['fromUser','toUser'])->get();
    }
}